package reflect;

/**
 * 通过反射机制访问注解
 */
public class ReflectDemo8 {
    public static void main(String[] args) throws ClassNotFoundException {
        //查看Person类上是否被注解@AutoRunClass
        Class cls = Class.forName("reflect.Person");//获取类对象

        boolean mark = cls.isAnnotationPresent(AutorunClass.class);//判断是否被注解@AutoRunClass
        if (mark){
            System.out.println("被标注了");
        }else{
            System.out.println("没有被标注");
        }
    }
}
